<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{ $t("hello") }}</text>
		</view>
		<view @click="changeLange">点击修改语言</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello'
			}
		},
		onLoad() {

		},
		onShow() {
			console.log('m', this.$i18n.messages[this.$i18n.locale].index.nav)
			this.setConfig()
		},
		methods: {
			setConfig() {
				uni.setNavigationBarTitle({ // 修改头部标题
					title: this.$i18n.messages[this.$i18n.locale].index.title
				});
				uni.setTabBarItem({ // 修改底部导航
					index: 0,
					text: this.$i18n.messages[this.$i18n.locale].index.nav,
				});
				uni.setTabBarItem({ // 修改底部导航
					index: 1,
					text: this.$i18n.messages[this.$i18n.locale].login.nav,
				});
			},
			changeLange() {
				this.switchLang('zh_CN')
				this.setConfig()
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>